import { getParamsAttr } from "../api/goods";
import {useEffect,useState} from 'react';
let useParamsAttr = (id:number,sel:"only"|"many")=>{
    let [data,setData] = useState<ParamsAttrType[]>();
    useEffect(()=>{
      getParamsAttr(id,sel).then(res=>{
        if(res.data.meta.status ===200){
            setData(res.data.data)
        }
      })
    },[]);
    return data;
}

export default useParamsAttr;